<?php
use app\models\Activity;
use app\utils\BaseUtils;
use yii\helpers\Html;
use yii\helpers\Url;

/* @var $user \app\models\User */
/* @var $model \app\models\ActivityApply */
\app\assets\MuiImageAsset::register($this);
?>
<style>
    .user-avatar{
    position: absolute;
    left: 50%;
    margin-left: -42px;
    top: -40px;
    border: 2px solid #fff;
    border-radius: 50px;overflow: hidden;
    }
    .user-avatar img{
    width: 80px;
    height: 80px;border-radius: 50px;display: block;
    }
</style>
<nav class="mui-bar mui-bar-tab  bar-btns">

    <div class="agree-group">
    <?php if($model->getIsPending()): ?>
        <button type="button" id="<?= Url::to(['activity-apply/deny', 'id' => $model->id]); ?>" class="mui-btn mui-btn-danger mui-btn-outlined deny-apply">&nbsp;拒绝&nbsp;</button>
        <button type="button" id="<?= Url::to(['activity-apply/allow', 'id' => $model->id]); ?>" class="mui-btn mui-btn-agree mui-btn-outlined allow-apply">&nbsp;通过&nbsp;</button>
    <?php elseif ($model->getIsDeny()): ?>
        <button type="button" class="mui-btn mui-btn-agree mui-btn-outlined disabled">报名被拒绝(<?= Html::encode($model->remark); ?>)</button>
    <?php endif; ?>
    </div>
</nav>

<div class="mui-content">
    <div class="h15"></div>
    <div class="h15"></div><div class="h15"></div>
    <div class="h15"></div>
    <div class="section-view mb15 pr">
        <div class="h15"></div><div class="h15"></div>

        <div class="user-avatar">
            <img src="<?= $user->getAvatar(); ?>"/>
        </div>

        <div class="txt-con">
            <h4>
                <b>▏</b>个人简历
            </h4>

            <div class="con">

                <table border="0" cellspacing="0" cellpadding="0" width="100%" class="table-info">
                    <tr><th>姓　　名:  </th><td><?= Html::encode($user->uname); ?> </td></tr>
                    <tr>
                        <th>性　　别: </th>
                        <td><?= $user->profile->_statusName(\app\models\User::$sexLabels, 'sex'); ?>　</td>
                    </tr>
                    <tr>
                        <th>电　　话: </th>
                        <td><?= Html::encode($user->phone); ?></td>
                    </tr>
                    <tr>
                        <th>微　　信: </th>
                        <td><?= Html::encode($user->profile->wechat); ?></td>
                    </tr>
                    <tr>
                        <th>电子邮箱: </th>
                        <td><?= Html::encode($user->profile->email); ?></td>
                    </tr>
                </table>

            </div>
        </div>
    </div>

    <div class="section-view mb15">

        <div class="txt-con">
            <h4>
                <b>▏</b>自我介绍
            </h4>
            <div class="con">
                <div>
                    <?= Html::encode($user->profile->experience1); ?>
                </div>
            </div>
        </div>
    </div>

    <div class="section-view mb15">

        <div class="txt-con">
            <h4>
                <b>▏</b>教育经历
            </h4>
            <div class="con">
                <table border="0" cellspacing="0" cellpadding="0" width="100%" class="table-info">
                    <tr><th>学校名称: </th><td><?= Html::encode($user->profile->school); ?> </td></tr>
                    <tr>
                        <th>专业:</th>
                        <td><?= Html::encode($user->profile->major); ?></td>
                    </tr>
                </table>
            </div>
        </div>
    </div>

    <?php if(in_array($model->activity->cid, [Activity::CID_ZHI_YUAN_ZHE, Activity::CID_JOB])): ?>
    <div class="section-view mb15">
        <div class="txt-con">
            <h4>
                <b>▏</b>赛事经历
            </h4>
            <div class="con">
                <div>
                    <?= Html::encode($user->profile->experience2); ?>
                </div>
            </div>
        </div>
    </div>


    <div class="section-view mb15">

        <div class="txt-con">
            <h4>
                <b>▏</b>志愿经历
            </h4>
            <div class="con">
                <div>
                    <?= Html::encode($user->profile->experience3); ?>
                </div>
            </div>
        </div>
    </div>
    <?php endif; ?>

    <?php if(in_array($model->activity->cid, [Activity::CID_JOB, Activity::CID_PRACTICE, Activity::CID_ZHI_YUAN_ZHE])): ?>
    <div class="section-view mb15">

        <div class="txt-con">
            <h4>
                <b>▏</b>兼职经历
            </h4>
            <div class="con">
                <div>
                    <?= Html::encode($user->profile->experience4); ?>
                </div>
            </div>
        </div>
    </div>
    <?php endif; ?>

    <?php if(in_array($model->activity->cid, [Activity::CID_ZHI_YUAN_ZHE, Activity::CID_JOB])): ?>
    <div class="section-view mb15">

        <div class="txt-con">
            <h4>
                <b>▏</b>证书展示
            </h4>
            <div class="con">
                <?= BaseUtils::arrayToImage($user->profile->getThumbsByFiled('user_images')); ?>
            </div>
        </div>
    </div>
    <?php endif; ?>
</div>
